#include "../../mqServer/connection.hpp"
#include <gtest/gtest.h>

using namespace mq;

ConnectionManager::ptr manager;
class ConnectionlTest : public testing::Environment
{
public:
    virtual void SetUp() override
    {
        cout << "所有单元测试前执行环境初始化" << endl;
        manager = make_shared<ConnectionManager>();
        manager->newConnection(make_shared<ConsumerManager>(),
                               muduo::net::TcpConnectionPtr(),
                               ProtobufCodecPtr(),
                               make_shared<VirtualHost>("host1", "./host/data", "host.db"),
                               ThreadPool::ptr());
    }
    virtual void TearDown() override
    {
        cout << "所有单元测试后执行环境清理" << endl;
    }
};

TEST(connection_test, test)
{
}

int main(int argc, char *argv[])
{
    testing::InitGoogleTest(&argc, argv);
    testing::AddGlobalTestEnvironment(new ConnectionlTest);
    RUN_ALL_TESTS();
    return 0;
}